import {makeObservable, observable, action, runInAction, computed} from 'mobx'

export default class {
  constructor() {
    makeObservable(this, {
      msg: observable,
      len: computed,
      msgFn: action
    })
  }
  msg = '1 2 3 4';
  get len () {
    return this.msg.split('').reverse().join('')
  }
  msgFn(val) {
    runInAction(() => this.msg = val)
  }
}